-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
The version released in February 2022.
Installed and tested. |
@donald why not merged then? |
|
||
mkdir -p $PREFIX | ||
cat >$PREFIX/profile <<-EOF | ||
PATH=$PREFIX/bin:\$PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From bash(1):
If the redirection operator is <<-, then all leading tab characters are stripped from input lines and the line containing delimiter. This allows here-documents within shell scripts to be indented in a natural fashion.
So tabs should be used.
Tabs are evil. Please don't use them. There is no standard concerning size, so using them rips intended formatting. |
issue: bash broke <<- redirection operator. leading tabs get deleted. next time I'll use |
" bash broke <<- redirection operator" is a funny way to say that you wrongly used space instead of tab. But I didn't catch it either. Probably caused by a smart editor converting between tabs and spaces on its own. It makes sense to avoid this danger in the future by not indenting the HERE docs at all. |
why not just use
|
Same problem, if editor replaces a string of spaces by tabs on the "WANTED INDENTED" line.
Edit: Changed |
No idea, why there were so many misunderstanding, and why it blew up. I just commented on a minor detail, so next time it can be avoided. Here-documents are pretty handy, and shorter than the sed hacks. |
I agree on the style provided by Donald. The problem is that there is no reason to use tabs and many against it. Furthermore, shorter but more error-prone in real life. Eleven characters can solve all the issues and being easy to read and understand. Also it's not an overall commitment, so feel free to use tabs in your scripts. You correctly mentioned my non-awareness of the <<- docs but I dislike the recommendation of that and therefore we discussed an alternative. |
The version released in February 2022.